////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                            //
//                                                         WNProject                                                          //
//                                                                                                                            //
//            This file is distributed under the BSD 2-Clause open source license. See License.txt for details.               //
//                                                                                                                            //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef __WN_MATH_BOUNDS_3_H__
#define __WN_MATH_BOUNDS_3_H__

#include "WNCore/inc/WNTypes.h"
#include "WNMath/inc/WNPoint3.h"

namespace WNMath {
    class WNBox;
    class WNSphere;
    class WNVector3;

    class WNBounds3 {
    public:
        WNBounds3();
        explicit WNBounds3(const WN_FLOAT32* _f);
        explicit WNBounds3(const WNPoint3& _point);
        explicit WNBounds3(const WNPoint3& _min, const WNPoint3& _max);

        WN_BOOL operator == (const WNBounds3& _bounds) const;
        WN_BOOL operator != (const WNBounds3& _bounds) const;

        WN_VOID Zero();
        WN_VOID Expand(WN_FLOAT32 _amount);
        WN_BOOL Expand(const WNPoint3& _point);
        WN_BOOL Expand(const WNBox& _box);
        WN_BOOL Expand(const WNSphere& _sphere);
        WN_BOOL Expand(const WNBounds3& _bounds);
        WN_VOID Translate(const WNVector3& _vector);

        WN_FLOAT32 Length() const;
        WN_FLOAT32 Width() const;
        WN_FLOAT32 Height() const;
        WN_FLOAT32 Radius() const;
        WN_FLOAT32 SurfaceArea() const;
        WN_FLOAT32 Volume() const;

        WN_BOOL IsZero() const;
        WN_BOOL IsInsideOut() const;

        WNBounds3 GetExpanded(WN_FLOAT32 _amount) const;
        WNBounds3 GetExpanded(const WNPoint3& _point) const;
        WNBounds3 GetExpanded(const WNBox& _box) const;
        WNBounds3 GetExpanded(const WNSphere& _sphere) const;
        WNBounds3 GetExpanded(const WNBounds3& _bounds) const;
        WNBounds3 GetTranslated(const WNVector3& _vector) const;
        WN_VOID GetPoints(WNPoint3* _points) const;

        WNBox ToBox() const;

    public:
        WNPoint3 mMinimum;
        WNPoint3 mMaximum;
    };
}

#endif // __WN_MATH_BOUNDS_3_H__